package org.hxd.notice.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.hxd.pojo.Notice;
import org.hxd.pojo.User_inf;
import org.hxd.units.PageModel;

import java.util.List;

/**
 * company: www.abc.com
 * Author: Administrator
 * Create Data: 2021/4/2 0002
 */
public interface NoticeDao {
    //参数矫正，（条件）查询公告信息
    List<Notice> findnotice(@Param("notice") Notice notice, @Param("pageModel") PageModel pageModel);
    //查询公告数量
    int findNoticeCount(Notice notice);

    @Insert("insert into notice_inf (" +
            "title,content,user_id) " +
            "values(#{notice.title},#{notice.content},#{id})")
    int addNotice(@Param("notice") Notice notice,@Param("id") Integer id);
    //参数矫正
    int removeNotice(@Param("ids") Integer[] ids);

    @Select("select * from notice_inf where id = #{id}")
    Notice findNoticeById(int id);

    @Update("update notice_inf set title=#{title},content=#{content} where id = #{id}")
    int updateNotice(Notice notice);
}
